<?php

date_default_timezone_set('PRC');
echo date('Y年m月d日 H:i:s');

// getdate()获取时间的数组信息
print_r(getdate());
/*
Array
(
    [seconds] => 56
    [minutes] => 25
    [hours] => 13
    [mday] => 25
    [wday] => 1
    [mon] => 1
    [year] => 2021
    [yday] => 24
    [weekday] => Monday
    [month] => January
    [0] => 1611552356
)
 */
// 这样就可以方便的获取年份，月份等信息了
echo getdate()['year']; // 2021